<template>
	<view class="setup-page">
		<view class="cell-box">
			<view class="cell-item" v-if="userInfo.is_pwd == 1" @click="goUrl('/pages/my/payPass/modifyPayPass')">
				<view class="label">修改支付密码</view>
				<u-icon name="arrow-right" color="#333" size="28rpx"></u-icon>
			</view>
			<view class="cell-item" v-else-if="userInfo.is_pwd == 0" @click="goUrl('/pages/my/payPass/setPayPass')">
				<view class="label">设置支付密码</view>
				<u-icon name="arrow-right" color="#333" size="28rpx"></u-icon>
			</view>
		</view>
	</view>
</template>

<script>
	import { getMaterial } from '@/api/api'
	
	export default {
		data () {
			return {
				userInfo: {}
			}
		},
		onLoad () {
			getMaterial().then(res => {
				if (res) {
					this.userInfo = res.data.data
				}
			})
		},
		methods: {
			goUrl (url) {
				uni.navigateTo({
					url
				})
			}
		}
	}
</script>

<style lang="scss">
.setup-page {
	box-sizing: border-box;
	min-height: 100%;
	padding: 28rpx;
	background-color: $bg-color;
	.cell-box {
		padding: 0 20rpx;
		border-radius: 20rpx;
		background-color: #fff;
		.cell-item {
			height: 88rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			.label {
				color: #333;
				font-size: 28rpx;
			}
		}
	}
}
</style>
